<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f = "http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui" 
      xmlns:ui="http://java.sun.com/jsf/facelets">
    <h:head>
        <title>RefPortal</title>
        <link rel="stylesheet" href="css/stylesheet.css" type="text/css" />
    </h:head> 
    <h:body>
        <ui:composition template="./BannersAndMenusTemplate.jsf">

            <ui:define name="content">
                <h:form rendered="#{user.login2}"> 
                    <a href="login.jsf">please log in again</a>
                </h:form>

                <h:form  rendered="#{user.login}" id="fromss"> 
                    <p:panel header="Reference Details">
                        <h:panelGrid columns="2" title="Reference Details:">  

                            <h:outputLabel  value="Type:" /> 
                            <p:selectOneMenu id="type" value="#{user.type}" effect="fade" style="width:160px" panelStyle="width:150px" 
                                             filter="true" filterMatchMode="startsWith" var="p" >   
                                <f:selectItem itemLabel="Select Type" itemValue="" />  
                                <f:selectItems value="#{user.types}" />   
                                <p:ajax listener="#{user.display()}" update=":fromss"/>
                            </p:selectOneMenu> 
                            
                          
                            
                            <h:outputLabel  value="Title:" />  
                            <p:inputText value = "#{user.title}"/> 

                            <h:outputLabel  value="Year:" />  
                            <p:inputText  value="#{user.year}"   />

                            

                            <h:outputLabel  value="Edition:" rendered="#{user.renderEdition}"/>  
                            <p:inputText  value="#{user.edition}" rendered="#{user.renderEdition}" />  


                            <h:outputLabel  value="City:" rendered="#{user.renderCity}"/>  
                            <p:inputText  value="#{user.city}" rendered="#{user.renderCity}"  />

                            <h:outputLabel  value="Doi:" rendered="#{user.renderDoi}" /> 
                            <p:inputMask value="#{user.doi}" rendered="#{user.renderDoi}" mask="99.9999/?***********************************"/> 

                            <h:outputLabel  value="ISBN10:" rendered="#{user.renderIsbn}"/>      
                            <p:inputMask value="#{user.isbn10}" rendered="#{user.renderIsbn}" mask="9-99-999999-*"/>  

                            <h:outputLabel  value="ISBN13:" rendered="#{user.renderIsbn}" />  
                            <p:inputMask value="#{user.isbn13}" rendered="#{user.renderIsbn}" mask="999-9-99-999999-*"/>   


                            <h:outputLabel  value="Pages:" rendered="#{user.renderPages}" />  
                            <p:inputText  value="#{user.pages}"  rendered="#{user.renderPages}"/>


                            <h:outputLabel  value="Volume:" rendered="#{user.renderVolume}"/>  
                            <p:inputText  value="#{user.volume}"  rendered="#{user.renderVolume}"/>

                            <h:outputLabel  value="Issue:" rendered="#{user.renderIssue}"/>  
                            <p:inputText  value="#{user.issue}"  rendered="#{user.renderIssue}"/>

                            <h:outputLabel  value="URL:" rendered="#{user.renderUrl}"/>  
                            <p:inputText  value="#{user.address}"  rendered="#{user.renderUrl}"/>

                            <h:outputLabel  value="Retrieve Date:" rendered="#{user.renderDate}"/>  
                            <p:calendar value="#{user.date2}" id="popupCal" rendered="#{user.renderDate}"/>

                            <p:dialog header="Selected Dates" widgetVar="dialog"   
                                      showEffect="fade" hideEffect="fade">  

                                <h:panelGrid id="display" columns="2" cellpadding="5">  

                                    <h:outputText value="Popup Date:" />  
                                    <h:outputText value="#{user.date2}" id="popupDate">  
                                        <f:convertDateTime pattern="d/M/yyyy"/>  
                                    </h:outputText>   

                                </h:panelGrid>  

                            </p:dialog>   
 
                            <h:outputLabel  value="" />   

                            <h:outputLabel  value="Other:" />  
                            <p:inputText  value="#{user.other}" />

                            <h:outputLabel  value="Language:" />  

                            <p:selectOneMenu value="#{user.language}" panelStyle="width:150px"  
                                             effect="fade" var="p" style="width:160px"  filter="true" filterMatchMode="startsWith">  
                                <f:selectItem itemLabel="Select One" itemValue="" />  
                                <f:selectItems value="#{user.languages}" />  

                                  
                            </p:selectOneMenu>

                            <h:outputLabel  value="Subject:" />  
                            <p:inputText  value="#{user.subject}" />

                        </h:panelGrid>  
                        <p:commandButton id="saveButton3" value="Next" action = "#{user.createRef}"/>  
                    </p:panel>
                </h:form>
            </ui:define>

        </ui:composition> 












    </h:body> 
</html>

